Skip to content

Add symlink directory for easy log access#217

Open
Bruce1102 wants to merge 4 commits intoPoint72:mainfrom
Bruce1102:bl/logs-symlink
Open

Add symlink directory for easy log access#217
Bruce1102 wants to merge 4 commits intoPoint72:mainfrom
Bruce1102:bl/logs-symlink

Conversation

@Bruce1102
Copy link

Creates flat directory with symlinks to Hydra's timestamped logs for easier tailing, searching, and monitoring.

Example:

cli_log_links/
  ├── cli_20260213_104733.log -> ../outputs/hostname_cli/2026-02-13/10-47-33/csp-gateway.log
  ├── cli_20260213_105000.log -> ../outputs/hostname_cli/2026-02-13/10-50-00/csp-gateway.log
  ├── cli_20260213_121921.log -> ../outputs/hostname_cli/2026-02-13/12-19-21/csp-gateway.log
  └── latest.log -> ../outputs/hostname_cli/2026-02-13/12-19-21/csp-gateway.log

Changes

  • Add SymlinkFileHandler extending logging.FileHandler
  • Creates {job_name}_log_links/ with timestamped symlinks + latest.log
  • Update Hydra logging config to use new handler

Notes:

  • Symlinks created on handler init, no runtime overhead
  • Failures logged but non-fatal - actual logs unaffected
  • latest.log always points to current(which is the newest) running instance, updated atomically on new runs
  • Directory name configurable via hydra.job.name for multi-instance deployments
  • No changes to existing log files in outputs/

Bruce1102 and others added 3 commits February 13, 2026 13:25
Signed-off-by: Bruce Lau <bruce.lau@cubistsystematic.com>
- Add type hints for *args/**kwargs to comply with style guide
- Narrow exception handling to OSError/PermissionError
- Fix test to let FileHandler create log file naturally
- Add tests for actual log writing and symlink updates
- Remove double exception logging between init and helper method

Signed-off-by: Bruce Lau <bruce.lau@cubistsystematic.com>
@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 89.58333% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.88%. Comparing base (d9abe73) to head (8de32f8).

Files with missing lines Patch % Lines
csp_gateway/server/shared/symlink_file_handler.py 70.58% 8 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #217      +/-   ##
==========================================
+ Coverage   84.84%   84.88%   +0.03%     
==========================================
  Files         126      128       +2     
  Lines       11891    11987      +96     
  Branches     1194     1196       +2     
==========================================
+ Hits        10089    10175      +86     
- Misses       1448     1456       +8     
- Partials      354      356       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@timkpaine timkpaine added type: feature Feature requests component: modules PRs or issues related to the specific modules labels Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: modules PRs or issues related to the specific modules type: feature Feature requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants